package com.sense.kukoo.common.media.watcher

import com.sense.kukoo.common.media.bean.LocalMediaListItemBean

interface UserWatcher {
    
    fun register(watcher:MusicStateWatcher)
    fun unregister(watcher:MusicStateWatcher)

    interface MusicStateWatcher {

        fun onMusicChanged(music: LocalMediaListItemBean)
        fun onPlayTimeChanged(currentInt:Int, totalInt:Int, current:String, total:String)
        fun onPlayPercentChanged(percent:Int)
        fun onPlayStateChanged(state:Int)
        fun onPlaySpeedChanged(speed:Float)
        fun onPlayListChanged()

        companion object{
            val STATE_NOT_PLAYING       =   0//无播放内容
            val STATE_PREPARE           =   1//播放前
            val STATE_PLAYING           =   2//播放中
            val STATE_SEEKING           =   3//快进处理中，处理完毕回到播放中
            val STATE_PAUSE             =   4//暂停，可以回到播放中
            val STATE_ERROR_RETRYING    =   5//异常处理

            val SPEED_1P0 = 1.0F
            val SPEED_2P0 = 2.0F
            val SPEED_1P2 = 1.2F
            val SPEED_1P5 = 1.5F
            val SPEED_0P8 = 0.8F
        }
    }

    interface TimerStateWatcher{
        fun onTimerChanged(type:Int, left:Long, leftStr:String)
    }
}